class Cat:
    def __init__(self,new_name):
        self.name = new_name
        print("%s 来了" % self.name)
    def __del__(self):
        print("%s 走了" % self.name)
tom = Cat("Tom")
#调用del方法会将对象从内存中删除
#del tom

print("---" * 50)